﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using TinaX;
using TinaX.Services;
using UnityEngine;
using UnityEngine.AddressableAssets;

public class XServerVFS : IAssetService
{
    T IAssetService.Load<T>(string assetPath)
    {
        throw new NotImplementedException("不能使用同步加载方法IAssetService.Load，加载：" + assetPath);
    }

    UnityEngine.Object IAssetService.Load(string assetPath, Type type)
    {
        throw new NotImplementedException("不能使用同步加载方法IAssetService.Load，加载：" + assetPath + "type:" + type);
    }

    async Task<T> IAssetService.LoadAsync<T>(string assetPath)
    {
        T op = await Addressables.LoadAssetAsync<T>(assetPath).Task;
        return op;
    }

    void IAssetService.LoadAsync(string assetPath, Type type, Action<UnityEngine.Object, XException> callback)
    {
        throw new NotImplementedException(assetPath + " type:" + type + " with call back");
    }

    void IAssetService.Release(UnityEngine.Object asset)
    {
        Addressables.Release(asset);
    }
}
